//
//  LCZSpecialTableViewCell.m
//  PersonalNews
//
//  Created by dllo on 15/11/30.
//  Copyright © 2015年 changshuhua. All rights reserved.
//

#import "LCZSpecialTableViewCell.h"

@implementation LCZSpecialTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView {
    
    self.titleLabel = [[LCZBaseLabel alloc] init];
//    self.titleLabel.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:self.titleLabel];
    
    self.digestLabel = [[LCZBaseLabel alloc] init];
    [self.contentView addSubview:self.digestLabel];
    self.digestLabel.font = [UIFont systemFontOfSize:13];
    self.digestLabel.numberOfLines = 0;
//    self.digestLabel.backgroundColor = [UIColor yellowColor];
    self.digestLabel.textColor = [UIColor lightGrayColor];
    
    self.specialLabel = [[LCZBaseLabel alloc] init];
    [self.contentView addSubview:self.specialLabel];
//    self.specialLabel.backgroundColor = [UIColor grayColor];
    self.specialLabel.text = @"专题";
    self.specialLabel.textAlignment = NSTextAlignmentCenter;
    self.specialLabel.textColor = [UIColor redColor];
    self.specialLabel.layer.borderWidth = 1;
    self.specialLabel.layer.cornerRadius = 5;
    self.specialLabel.layer.masksToBounds = YES;
    self.specialLabel.layer.borderColor = [UIColor redColor].CGColor;
    self.specialLabel.font = [UIFont systemFontOfSize:13];
    
    self.imgsrcView = [[LCZBaseImageView alloc] init];
    [self.contentView addSubview:self.imgsrcView];
//    self.imgsrcView.backgroundColor = [UIColor magentaColor];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    [self.imgsrcView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.contentView).with.offset(10);
        make.bottom.equalTo(self.contentView).with.offset(-10);
        make.width.mas_equalTo(80);
        make.left.equalTo(self.contentView).with.offset(5);
        
    }];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.imgsrcView.mas_right).with.offset(5);
        make.top.equalTo(self.contentView).with.offset(10);
        make.right.equalTo(self.contentView).with.offset(-5);
        make.height.mas_equalTo(23);
        
    }];
    
    [self.digestLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.imgsrcView.mas_right).with.offset(5);
        make.top.equalTo(self.titleLabel.mas_bottom).offset(0);
        make.bottom.equalTo(self.contentView).with.offset(-10);
        make.right.equalTo(self.contentView).with.offset(-5);
        
    }];
    
    [self.specialLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.equalTo(self.contentView).with.offset(-5);
        make.bottom.equalTo(self.contentView).with.offset(-10);
        make.height.mas_equalTo(20);
        make.width.mas_equalTo(32);
        
    }];
    
}

@end
